﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Model;
using BLL;

namespace 联盟酒店
{
    public partial class personal : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                showmakeroom();
               
                shownametel();
            }
        }
        /// <summary>
        /// 显示当前用户预约房间信息
        /// </summary>
        public void showmakeroom()
        {
           string id=Session["roomtid"].ToString();
            Repeater1.DataSource = BLL.makebll.showmakeroom(id);
            Repeater1.DataBind();
        }

        protected void updatemake_Click(object sender, EventArgs e)
        {
            Response.Redirect("modify.aspx?id=" + Session["mids"]);
        }
        public void shownametel()
        {
            yname.Value = Session["name"].ToString();
            ytel.Value = Session["tel"].ToString();

        }

        protected void qmake_Command(object sender, CommandEventArgs e)
        {

            string id = e.CommandArgument.ToString();//获取要删除的预约信息id
            int r = BLL.makebll.DeleteMake(id);
            if (r > 0)
            {
                Response.Write("<script>alert('您已取消本次预约');location.href=('personal.aspx');</script>");

            }
        }

            protected void ymake_Click(object sender, EventArgs e)
        {

            string roomtid = Session["roomtid"].ToString();

            List<MakeroomModel> r = BLL.makebll.showmakeroom(roomtid);
            string id = r[0].mid.ToString();
            Repeater1.DataSource = r;
            Repeater1.DataBind();

        }
    }
}